"use strict";

//var sequelize = require('../sequelize.js');
var sequelize = require('../sequelize.js');
var Sequelize = require('sequelize');
let DataTypes = Sequelize;

var Order = sequelize.define('mh_wiki', {
    id: {
      type: DataTypes.INTEGER(10),
      primaryKey: true,
      autoIncrement: true,
      allowNull: false
    },
    //页面标题
    pageName: {
      type: DataTypes.STRING(),
      allowNull: false
    },
    //内容
    content: {
      type: DataTypes.STRING(),
      allowNull: false
    },
    //页面类型 1 百科页面 2活动页面
    type: {
      type: DataTypes.INTEGER(10),
      allowNull: false,
      defaultValue: '1'
    },
    //type对应的record id
    idFromType: {
      type: DataTypes.INTEGER(10),
      allowNull: true
    },
    status: {
      type: DataTypes.INTEGER(10),
      allowNull: false,
      defaultValue: '1'
    }
  },
  {
    indexes: [
      {
        unique: true,
        fields: ['id']
      }
    ],
    tableName: 'mh_wiki',
    createdAt: false,
    updatedAt: false
  }
);

module.exports = Order;